<include file="Public:headerMy" />
<load href="__PUBLIC__/Js/editor/kindeditor-min.js" />
<script>
var editor;
</script>
<div id="main" class="main" >
<div class="content">
<div class="title">编辑单位不动产信息 [ <a href="__URL__">返回列表</a> ]</div>
<form method="post" id="form2" name="form2">
<table width="90%" cellpadding=3 cellspacing=3>
<tr>
	<td class="tRight" >占地面积：</td>
	<td width="30%" class="tLeft" ><input type="number" size="7" min="100" class="medium bLeftRequire" name="zdmj" value="{$vo.zdmj}" title="单位的占地总面积">平方米</td><td class="tRight"></td><td width="30%"></td><td class="tRight"><a href="#" id="a_pmt" f="pmt" s="平面图">查看平面图</a></td>
</tr>
<tr>
	<td class="tRight tTop">建筑面积：</td>
	<td class="tLeft"><input type="number" class="medium bLeftRequire" name="jzmj" value="{$vo.jzmj}" title="单位的总建筑面积">平方米</td><td class="tRight">建筑栋数:</td><td class="tLeft"><input type="number" class="medium bLeftRequire" name="jzds" value="{$vo.jzds}" title="单位建筑的栋数">栋</td><td class="tRight"><a href="#" id="a_xgt" f="xgt" s="效果图">查看效果图</a></td>
</tr>
<tr>
	<td class="tRight" >办公面积：</td>
	<td class="tLeft" ><input type="number" class="medium bLeft" name="bgmj" value="{$vo.bgmj}" title="单位办公室的总使用面积">平方米</td><td class="tRight">办公室数:</td><td class="tLeft"><input type="number" class="medium bLeft" name="bgss" value="{$vo.bgss}" title="单位办公室的间数">个</td><td></td>
</tr>
<tr>
	<td class="tRight" >教室面积：</td>
	<td class="tLeft" ><input type="number" class="medium bLeft" name="jsmj" value="{$vo.jsmj}" title="单位教室的总使用面积">平方米</td><td class="tRight">教室数量:</td><td class="tLeft"><input type="number" class="medium bLeft" name="jssl" value="{$vo.jssl}" title="单位教室的间数">个</td><td></td>
</tr>
<tr>
	<td class="tRight" >实验面积：</td>
	<td class="tLeft" ><input type="number" class="medium bLeft" name="symj" value="{$vo.symj}" title="实验室的总使用面积">平方米</td><td class="tRight">实验室数:</td><td class="tLeft"><input type="number" class="medium bLeft" name="syss" value="{$vo.syss}" title="实验室的间数">个</td><td></td>
</tr>
<tr>
	<td class="tRight" >准备面积：</td>
	<td class="tLeft" ><input type="number" class="medium bLeft" name="zbmj" value="{$vo.zbmj}" title="实验室之准备室的总使用面积">平方米</td><td class="tRight">准备室数:</td><td class="tLeft"><input type="number" class="medium bLeft" name="zbss" value="{$vo.zbss}" title="实验室之准备室的间数">个</td><td></td>
</tr>
<tr>
	<td class="tRight" >会议面积：</td>
	<td class="tLeft" ><input type="number" class="medium bLeft" name="hymj" value="{$vo.hymj}" title="会议室及综合电教室的总使用面积">平方米</td><td class="tRight">会议室数:</td><td class="tLeft"><input type="number" class="medium bLeft" name="hyss" value="{$vo.hyss}" title="会议室及综合电教室的间数">个</td><td></td>
</tr>
<tr>
	<td class="tRight" >图书面积：</td>
	<td class="tLeft" ><input type="number" class="medium bLeft" name="tsmj" value="{$vo.tsmj}" title="图书阅览室总使用面积">平方米</td><td class="tRight">图书室数:</td><td class="tLeft"><input type="number" class="medium bLeft" name="tsss" value="{$vo.tsss}" title="图书阅览室的间数">个</td><td></td>
</tr>
<tr>
	<td class="tRight" >功能面积：</td>
	<td class="tLeft" ><input type="number" class="medium bLeft" name="gnmj" value="{$vo.gnmj}" title="单位除上述室外的其他功能室的总使用面积">平方米</td><td class="tRight">功能室数:</td><td class="tLeft"><input type="number" class="medium bLeft" name="gnss" value="{$vo.gnss}" title="单位除上述室外的其他功能室的间数">个</td><td></td>
</tr>
<tr>
	<td class="tRight" >厨房面积：</td>
	<td class="tLeft" ><input type="number" class="medium bLeft" name="cfmj" value="{$vo.cfmj}" title="厨房的总使用面积">平方米</td><td class="tRight">餐厅面积:</td><td class="tLeft"><input type="number" class="medium bLeft" name="ctmj" value="{$vo.ctmj}" title="餐厅的总使用面积">平方米</td><td></td>
</tr>
<tr>
	<td class="tRight" >体育面积：</td>
	<td class="tLeft" ><input type="number" class="medium bLeft" name="tymj" value="{$vo.tymj}" title="室内体育用房的总建筑面积">平方米</td><td class="tRight">体育用房:</td><td class="tLeft"><input type="number" class="medium bLeft" name="tyyf" value="{$vo.tyyf}" title="室内体育用房的间数">个</td><td></td>
</tr>
<tr>
	<td class="tRight" >环跑道长：</td>
	<td class="tLeft" ><input type="number" class="medium bLeft" name="hpdc" value="{$vo.hpdc}" title="环形跑道的长度">米</td><td class="tRight">主跑道长:</td><td class="tLeft"><input type="number" class="medium bLeft" name="zpdc" value="{$vo.zpdc}" title="主跑道的长度">米</td><td></td>
</tr>
<tr>
	<td class="tRight" >足球场：</td>
	<td class="tLeft" ><input type="number" class="medium bLeft" name="zqc" value="{$vo.zqc}" title="足球场个数">个</td><td class="tRight">篮球场:</td><td class="tLeft"><input type="number" class="medium bLeft" name="lqc" value="{$vo.lqc}"  title="篮球场个数">个</td><td></td>
</tr>
<tr>
	<td class="tRight" >羽毛球场：</td>
	<td class="tLeft" ><input type="number" class="medium bLeft" name="ymqc" value="{$vo.ymqc}" title="羽毛球场个数">个</td><td class="tRight">乒乓球台:</td><td class="tLeft"><input type="number" class="medium bLeft" name="pbqt" value="{$vo.pbqt}" title="乒乓球台个数">个</td><td></td>
</tr>
<tr>
	<td></td>
	<td colspan="3" class="center"><input type="hidden" name="dwid" value="{$vo.dwid}" >
	<input type="hidden" name="ajax" value="1">
	<input type="button" value="保 存" onclick="save()" class="small submit">
	<input type="reset" class="submit small" value="清 空" ></td><td></td>
</tr>
</table>
</form>
</div>
</div>
<div class="hide">
	<div id="dlg_pmt" style="99%"><div id="div_pmt" style="99%">{$vo.pmt}</div></div>
    <div id="dlg_xgt" style="99%"><div id="div_xgt" style="99%">{$vo.xgt}</div></div>
</div>
<script>
jQuery(function(){
	$('#a_pmt,#a_xgt').click(function(){
		var ff = $(this).attr("f");
		var sf = $(this).attr("s");
		$('#dlg_'+ff).unbind().dialog({
			modal:true,title:sf+"添加或修改对话框(双击进入编辑状态)",width:620,height:520,
			buttons:[{
				text:'保存',iconCls:'icon-ok',
				handler:function(){
					var dwid 	= '{$Think.get.id}';
					$('#'+ff).html(editor.html());	
					var o		= {};//动态参数
					o[ff]		= editor.html();
					o['dwid']	= dwid;
					$.post("__URL__/update/",o,function(data){
						$.messager.show({title:'提示信息',msg:data.info,timeout:2000,showType:'slide'});
					}//function
					,"json");//post	
				}
			},{
				text:'关闭',handler:function(){
					$('#dlg_'+ff).dialog('close');
				}
			}]
		});	
		//不足5个字符时直接显示编辑器
		if($('#div_'+ff).html().length<5){
			editor = showEditor(ff,'99%',440);
		}else{
			jQuery('#dlg_'+ff).dblclick(function(){
				editor = showEditor(ff,'99%',440);
			})
		}
	})//平面图，效果图click
	$("#form2 :input").tooltip({
		position: "center right",
		offset: [-2, 10],
		effect: "fade",
		opacity: 0.7
	});
	//$("#form2").validator();
})

function showEditor(n,w,h){
	var ww = w>0?w+'px':'99%';
	var hh = h>0?h+'px':'99%';
	jQuery('#div_'+n).html("<TEXTAREA class=''  name='"+n+"' id='"+n+"'>"+$('#div_'+n).html()+"</textarea>");
	edt = KindEditor.create('textarea[name='+ n +']', {
		width:ww+'',height:hh+'',allowFileManager:true,
		items : [
			'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
			'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
			'insertunorderedlist', '|', 'emoticons', 'image', 'link','flash','media','insertfile','map']
	});	
	return edt;
}
function save(){
    var inputs = $("#form2 :input").validator({ lang: 'zh',position: 'right left',offset: [-12, 0],message: '<div><em/></div>' });
    if(inputs.data("validator").checkValidity()){
		var queryString = $('#form2').formSerialize();
		$.post('__URL__/update/',queryString,function(data){
			$.messager.show({
				title:'提示信息',msg:data.info,timeout:2000,showType:'slide'
			});
		},'json')	
	}
	
}
</script>